package ctrlMode

import (
	"emsctrl/proxy"
	"emsctrl/public"
	"fmt"
)

// 代理调度
type Proxyschedue struct {
	CuPolicy *public.CurrentPolicy
	CuProxy  public.Proxy_Inter
}

func (p *Proxyschedue) PvActivePowerSet(f float32) {
	//TODO implement me
	panic("implement me")
}

func (p *Proxyschedue) Implement() bool {
	//TODO implement me
	fmt.Println("Proxy sche me")
	p.CuProxy.Proxy_Run()
	return true
}

func (p *Proxyschedue) PcsOpenSet() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsCloseSet() {
	//TODO implement me
	fmt.Println("implement me")
}

func (a *Proxyschedue) PcsRemoteSet() {

}

func (p *Proxyschedue) BmsUpHighVolSet(onoff int) {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) BmsDownHighVolSet(onoff int) {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) AirCondOpenSet(onoff int) {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsActivePowerSet(power float32) {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsReactivePowerSet(power float32) {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsOpenCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsCloseCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) BmsUpHighVolCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) BmsDownHighVolCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) AirCondOpenCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsActivePowerCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PcsReactivePowerCheck() {
	//TODO implement me
	fmt.Println("implement me")
}

func (p *Proxyschedue) PolicySet(policy *public.CurrentPolicy) {
	//TODO implement me
	p.CuPolicy = policy
	fmt.Println("implement me")
	switch policy.RemoteAdjRemoteCtrMng.RemoteAdj.ProxyMode {
	case public.NORTH_SCHE:
		p.CuProxy = &proxy.Schedule{}
	case public.NORTH_MODBUS:
		p.CuProxy = &proxy.Sche_modbus{}
	case public.NORTH_IEC104:
		p.CuProxy = &proxy.Sche_iec104{}
	case public.NORTH_MODBUS_AUTO:
		p.CuProxy = &proxy.Sche_modbus_auto{}
	case public.NORTH_IEC104_AUTO:
		p.CuProxy = &proxy.Sche_iec104_auto{}
	}
	autoPolicy := AutoPolicy{}
	autoPolicy.PolicySet(policy)
	p.CuProxy.Proxy_para_set(policy, &autoPolicy)
}
